package com.data;

import java.util.Arrays;

public class Test_1 {
    public static void main(String[] args) {
        MyArraylist myArraylist = new MyArraylist();
        myArraylist.add(2);
        myArraylist.add(3);
        myArraylist.add(5);
    }
}

class MyArraylist implements Mylist{
    public int[]elem;
    public int size;


    public  MyArraylist(){
        elem=new int[10];
    }
    @Override
    public void add(int data) {
        elem[size++]=data;
    }



    public void info(){
        System.out.println(elem);
    }

    @Override
    public String toString() {
        return "MyArraylist{" +
                "elem=" + Arrays.toString(elem) +
                ", size=" + size +
                '}';
    }
}
